package com.system.data.service;

import com.system.data.dao.ChnAgriDao;
import com.system.data.model.ChnAgriArticle;
import com.system.data.model.ChnAgri_info;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Service
public class ChnAgriService {
    @Autowired
    private ChnAgriDao chnAgriDao;

    @GetMapping("/getChnAgriNews")
    @ResponseBody
    public List<ChnAgri_info> getChnAgriNews(@RequestParam String today){
        return chnAgriDao.findChnAgriNews(today);
    }

    @GetMapping("/getChnAgriArticle")
    @ResponseBody
    public List<ChnAgriArticle> getChnAgriArticle(@RequestParam String title){
        return chnAgriDao.findChnAgriArticle(title);
    }
}
